Load Required Libraries
Load and Prepare the Data

Create Interactive Charts with Annotations for the sectors 1- Air Transportation GDP Over Time

2 - Rail Transportation GDP Over Time

Water Transportation GDP Over Time

Truck Transportation GDP Over Time

list of sectors

policy_impacts <- data.frame( Year = c(1990, 2001, 2008), # Replace these with the actual policy years Policy = c(“Policy A”, “Policy B”, “Policy C”) )

gdp_plot <- ggplot(data, aes(x = year)) + geom_line(aes(y = total_u_s_gdp, color = “Total U.S. GDP”)) + geom_line(aes(y = for_hire_transportation_services_gdp_total, color = “For-Hire Transportation GDP”)) + geom_text(data = policy_impacts, aes(x = Year, y = max(data$total_u_s_gdp), label = Policy), vjust = -1, color = “black”, angle = 45) + labs(title = “GDP Contribution Over Time with Policy Annotations”, x = “Year”, y = “GDP in Billions of USD”) + theme_minimal()

ggplotly(gdp_plot) `````

Additional Sections for Different Sectors

To visualize GDP contributions by different transportation sectors

Add a new section to visualize Total U.S. GDP with Policy Impacts.

policy_impacts <- data.frame( year = c(1990, 2001, 2008), # Replace with actual years of policy impacts Policy = c(“Policy A”, “Policy B”, “Policy C”) )

gdp_plot <- ggplot(data, aes(x = year, y = total_u_s_gdp)) + geom_line(color = “blue”, size = 1) + geom_point(data = policy_impacts, aes(x = year, y = max(data\(total_u_s_gdp)), color = "red", size = 3) + geom_text(data = policy_impacts, aes(x = year, y = max(data\)total_u_s_gdp), label = Policy), vjust = -1, color = “black”, angle = 45, size = 3) + labs(title = “Total U.S. GDP with Policy Impacts”, x = “Year”, y = “GDP in Billions of USD”) + theme_minimal()

ggplotly(gdp_plot) ````